import request from '@/utils/request'

export const getRooms = () => {
  return request({
    url: '/rooms/getAllRoom',
    method: 'get'
  })
}

export const filterRooms = (data) => {
  return request({
    url: '/rooms/filter',
    method: 'post',
    data
  })
}

export const createRoom = (data) => {
  return request({
    url: '/rooms/create',
    method: 'post',
    data
  })
}

export const updateRoom = (id, data) => {
  return request({
    url: `/rooms/${id}/update`,
    method: 'put',
    data
  })
}

export const deleteRoom = (id) => {
  console.log(id)
  return request({
    url: `/rooms/${id}/delete`,
    method: 'delete'
  })
}

export const updateRoomStatus = (id, status) => {
  return request({
    url: `/rooms/${id}/status`,
    method: 'put',
    data: { status }
  })
}